A,B=map(list, raw_input().split(' '))
# complement 0 if B is shorter than A
if len(A)>len(B):
    B=[0]*(len(A)-len(B)) + B

A.reverse()
B.reverse()

i = 0
mapping=['0','1','2','3','4','5','6','7','8','9','J','Q','K']
res=[]
while i<len(A):
    if 0 == i%2:
        res.append(mapping[(int(A[i])+int(B[i]))%13])
    else:
        tmp = int(B[i])-int(A[i])
        if tmp<0:
            res.append(str(tmp+10))
        else:
            res.append(str(tmp))
    i+=1

res+=B[i:]

res.reverse()

print ''.join(res)